package com.tn.user.config;

import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RoundRobinRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author tn
 * @version 1
 * @ClassName RibbonConfig
 * @description 负载均衡算法规则配置
 * @date 2020/8/7 11:29
 */
@Configuration
public class RibbonConfig {
    @Bean
    public IRule rule(){
        return new RoundRobinRule();//轮询 （默认）
        //return new RetryRule();//重试
//        return new RandomRule(); //随机
    }
}
